package com.ponhu.ea2.support.exception;


import com.ponhu.ea2.enums.ResponseCodeEnum;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Data
public class BusinessRuntimeException extends RuntimeException {

    private static final long serialVersionUID = -6845028668264097201L;

    private ResponseCodeEnum codeEnum;

    private Integer code;

    public BusinessRuntimeException(ResponseCodeEnum codeEnum) {
        super(codeEnum.getMsg());
        this.codeEnum = codeEnum;
    }

    public BusinessRuntimeException(int code, String msg) {
        super(msg);
        this.code = code;
    }

    public BusinessRuntimeException(String message) {
        super(message);
    }

    public ResponseCodeEnum getCodeEnum() {
        return codeEnum;
    }

}
